package com.web.product.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import com.web.product.bean.Product;

@RestController
public class ProductController {
	
	@GetMapping(value="product/{id}")
	public Product getProduct(@PathVariable("id") Integer id, HttpServletRequest request) {
		Product product = new Product(id, "西瓜", 30,request.getRequestURL().toString());
		return product;
	}

}
